package Cordiali_Es2;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;

import Cordiali_Es2.Server.QueueType;
import arjuna.*;
import arjuna.JavaSim.Distributions.ErlangStream;
import arjuna.JavaSim.Distributions.ExponentialStream;
import arjuna.JavaSim.Distributions.SeedsData;
import arjuna.JavaSim.Simulation.Scheduler;
import arjuna.JavaSim.Simulation.SimulationProcess;
import arjuna.JavaSim.Statistics.Variance;

@SuppressWarnings("unused")

public class NumeriCasuali {

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		int tests = 10;
		double lambda = 0.1;
		int erlang_steps = 5;
		double p1 = 0.7;
		Double[][] results_same_seed = new Double[tests][2];
		Double[][] results_change_seed = new Double[tests][2];
		try {
			
			
			ErlangStream erlang = new ErlangStream(1/lambda, erlang_steps);
			HyperExponential2OrderStream hyper = new HyperExponential2OrderStream(1/lambda, p1);
			
			for(int i=0;i<tests;i++)
			{
				results_same_seed[i][0]=erlang.getNumber();
				results_change_seed[i][0]=results_same_seed[i][0];
			}
			
			erlang = new ErlangStream(1/lambda, erlang_steps);
			for(int i=0;i<tests;i++)
				results_same_seed[i][1]=erlang.getNumber();
			
			erlang = new ErlangStream(1/lambda, erlang_steps, erlang.GetSeedsData());
			for(int i=0;i<tests;i++)
				results_change_seed[i][1]=erlang.getNumber();
			
			System.out.println("Stesso seme (quello iniziale) -> stessi valori!");
			System.out.println("Sequenza 1\tSequenza 2");
			for(int i=0;i<tests;i++)
			{
				System.out.println(results_same_seed[i][0] + "\t" + results_same_seed[i][1]);
			}
			System.out.println("\nSeme mantenuto -> valori diversi!");
			System.out.println("Sequenza 1\tSequenza 2");
			for(int i=0;i<tests;i++)
			{
				System.out.println(results_change_seed[i][0] + "\t" + results_change_seed[i][1]);
			}
		}
		catch (ArithmeticException e) {}
		catch (IOException e) {}
	}
}
